import request from '@/sheep/request';

const AgentApi = {
  // 获取代理商分页列表
  getAgentPage: (params) => {
    return request({
      url: '/system/user-manage-app/list-by-ids',
      method: 'GET',
      params,
    });
  },

  //获取生产方列表
  getProduceList: (params) => {
    return request({
      url: '/system/user-manage-app/producer/list',
      method: 'GET',
      params,
    });
  },

  //是否是管理员
  getIsAdmin(){
    return request({
      url: '/system/user-manage-app/is-admin',
      method: 'GET',
    });
  },


  getUserManageList: (params) => {
    return request({
      url: '/system/user-manage-app/list',
      method: 'GET',
      params,
    });
  },

  // 获取代理商详情
  getAgent: (params) => {
    return request({
      url: '/system/user-manage-app/get',
      method: 'GET',
      params
    });
  },

  // 创建代理商
  createAgent: (data) => {
    return request({
      url: '/system/user-manage-app/create',
      method: 'POST',
      data,
    });
  },

  // 更新代理商
  updateAgent: ( data) => {
    return request({
      url: '/system/user-manage-app/update',
      method: 'PUT',
      data,
    });
  },

  // 删除代理商
  deleteAgent: (params) => {
    return request({
      url: '/system/user-manage-app/delete',
      method: 'DELETE',
      params
    });
  },

  // 根据条件搜索代理商
  searchAgents: (params) => {
    return request({
      url: '/api/agents/search',
      method: 'GET',
      params,
    });
  },
};

export default AgentApi;

